package com.yunhe.day322.service.impl;

import com.yunhe.day322.dao.PermissionDao;
import com.yunhe.day322.domain.Permission;
import com.yunhe.day322.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class PermissionServiceImpl implements PermissionService {
    @Autowired
    private PermissionDao perDao;
    @Override
    public List<Permission> findAll() {

        return perDao.findAll();
    }
    /**
     * 添加资源权限
     * @param permission
     */
    @Override
    public void save(Permission permission) {
        perDao.save(permission);
    }

    @Override
    public void deleteRole(int id) {
        perDao.deletePerMission(id);
        perDao.deleteRp(id);
    }
}
